#iterable class implements iter method
class Counter:
    
    def __init__(self, low, high):
        
        self.current = low
        self.high    = high

    def __iter__(self):
        return self

    def __next__(self): # Python 3: def __next__(self)
        if self.current > self.high:
            raise StopIteration
        else:
            #4 5 6 7 8 9 
            self.current += 1
            #3 4 5 6 7 8
            return self.current - 1
        
for c in Counter(3, 8):
    print (c)
    
#wywolanie iter
iterator = iter(Counter(3,8))
print (iterator.__next__())

    
    
